st/settings: Add magnifier activation property and bind to settings
The same code for reading the current magnifier state is repeated in both
shell-recorder, shell-screenshot and magnifier itself.
So to move this inside a property of st-settings so that we can refer to it
all over the places removing duplications.
Carlos Garnacho [Mon, 1 Apr 2019 16:06:49 +0000 (18:06 +0200)]
shell: Fallback on ISO 8601 datetime string for screenshot date info
If the locale doesn't honor strftime()'s %c argument, we would end up
feeding NULLs into GdkPixbuf tagging. Fallback to a sensible (although
not nicely localized) datetime string.
magnifier: Track cursor sprite changes only when active
There's no point in keeping the cursor sprite texture around all the time,
and to listen for its changes, we just need this when the magnifier is active.
So, initialize the magnifier texture and monitor for the sprite changes on
activation, while disconnect from the signal and nullify the texture when
the magnifier is deactivated.
magnifier: Use all color channels to paint content texture node
In order to paint all the color channels of the content texture we need to
set the color channels to 255, so instead of doing this manually we can just
reuse the static color definition for white.
magnifier: Return all parameters on sprite content preferred size
ClutterContent's get_preferred_size should return a boolean weather the
preferred size is valid, so in javascript we've to return this state value
before out width and height.
Since this was not happening, clutter was considering the width as the state
(converting the non-zero value to true), the height as the width, while ignoring
the returned height (that was then defaulted to 0)
Florian Müllner [Tue, 5 Feb 2019 01:32:52 +0000 (02:32 +0100)]
app: Consider "quit" action for quit
Just like we take a remote "new-window" action into account for
opening new windows, we should call an explicit "quit" action
before falling back to closing all the app's windows on quit.
The default ZoomRegion is created at startup and only updated if it is active
when the monitor setup changes. Thus when reactivating the magnifier after a
display change, the viewport used is still the one that been computed with the
old screen geometry values.
Move screen update code inside a function and call it both when activating
the zoom region and when the monitor changes during a zoom session.
Florian Müllner [Wed, 27 Mar 2019 16:50:20 +0000 (17:50 +0100)]
iconGrid: Chain up in style-changed
Commit 81ec8215a0c moved the handling of style changes from a signal
handler to a vfunc without chaining up to the parent, losing propagating
the change to children and queueing a paint update.
Florian Müllner [Thu, 7 Mar 2019 19:26:12 +0000 (20:26 +0100)]
network: Catch errors when reading devices
NetworkManager added support for a new device - NMDeviceWifiP2P - but
did not add the corresponding enum value in NMDeviceType. The return
value for nm_device_get_device_type() is therefore "illegal" for the
newly added device, and gjs throws an exception.
This should ultimately be fixed in libnm, but as errors when adding
one device shouldn't interfere with adding any other devices, catching
exception is a good idea anyway, so do just that.
Florian Müllner [Tue, 12 Feb 2019 16:11:24 +0000 (17:11 +0100)]
scripting: Don't use legacy API
The current scripting module makes heavy use of pre-standardized
iterator/generator/promise APIs, at least for some of those support
was pulled in SpiderMonkey 58.
Port to the new standardized replacements to get the module back into
a working state.
Florian Müllner [Tue, 5 Mar 2019 21:54:59 +0000 (22:54 +0100)]
perf: Use var for METRICS
Each perf module exposes it to the scripting module to report metrics
after all tests have been run. The symbol's scope should allow that,
so declare it as var.
Florian Müllner [Wed, 20 Mar 2019 12:48:21 +0000 (12:48 +0000)]
aggregateMenu: Include action buttons in width computation again
Commit 1b169655ac removed the system indicator from the list of children
that are considered for the overall menu width, because we do want the
log-out submenu to adapt to the available width.
However as a side effect, action buttons no longer contribute to the
width either, so if extensions add additional buttons, the menu is
likely to overflow.
Avoid this by only adding the button group to the list of size children.
Carlos Garnacho [Tue, 12 Mar 2019 00:53:16 +0000 (01:53 +0100)]
dnd: Make startDrag() fail if there is a current grab
This call just went through stomping over previous drag operations if any,
_maybeStartDrag() accounted for this, but other callers (well, WindowClone
in workspace.js) don't. This must bail out early even if a drag operation is
requested, luckily all callers account for it already.
This broke shell state by preserving connected captured-event handlers if
one tried to drag multiple windows simultaneously through multitouch. We
of course don't support that, now more elegantly.
Florian Müllner [Tue, 5 Mar 2019 10:34:27 +0000 (11:34 +0100)]
layout: Use custom actor for uiGroup
The bind constraint that replaced the Shell.GenericContainer in commit f4682748faf4 is subtly different from the previous code:
It forces the actor to have the same size as the stage, rather than just
requesting that size.
This breaks the magnifier which relies on the UI being able to be bigger
than the display size. Fix by going back to using a custom actor.
Florian Müllner [Thu, 7 Mar 2019 12:39:17 +0000 (13:39 +0100)]
userWidget: Fix avatar size
The texture cache now returns an actor with an appropriate ClutterContent
rather than a ClutterTexture. That actor uses the CONTENT_SIZE request
mode, which means that it will unconditionally request the preferred size
of the content. That is, setting an explicit size no longer has an effect.
Fix this by making sure the image is already loaded with the desired
dimensions.
Florian Müllner [Sun, 10 Mar 2019 20:57:54 +0000 (21:57 +0100)]
theme: Fix menu arrows
After the latest texture cache changes, loading the icon at its preferred
size and scaling it via the actor size no longer works. Instead, use the
icon-size property which is applied when loading the icon.
Florian Müllner [Fri, 8 Mar 2019 13:12:12 +0000 (14:12 +0100)]
theme: Handle fallback app icons in notifications
Since commit 3eb80dc6c0, the size of notification icons is determined
by the theme to make it font-relative. Also handle the case where the
icon isn't an StIcon, but a fallback window icon.
Florian Müllner [Fri, 8 Mar 2019 13:10:56 +0000 (14:10 +0100)]
app: Set styleclass on fallback app icons
For window backed apps, create_icon_texture() doesn't return an StIcon
but a generic widget. Set an appropriate style class to make it easier
to apply a specific style only to fallback icons.
Florian Müllner [Fri, 8 Mar 2019 13:08:27 +0000 (14:08 +0100)]
texture-cache: Fall back to actor size for bound textures
With StImageContent, the meaning of passing -1 as size parameter changed
from "load the image at its preferred size" to "abort the session". It
is therefore no longer possible to just load the image and then have it
scaled by applying a CSS size to the texture's parent.
Setting the size from CSS is useful though, so to still allow that, fall
back to the actor's size (which can be determined by the style).
Carlos Garnacho [Tue, 5 Mar 2019 18:33:49 +0000 (19:33 +0100)]
keyboard: align AspectContainer to bottom if restricting vertically
It is convenient for the OSK so it eg. doesn't appear centered in the
available space (eg. on very narrow portrait layouts), plus it will also
be convenient to align other AspectContainers to the same baseline.
Florian Müllner [Tue, 26 Feb 2019 00:57:01 +0000 (01:57 +0100)]
test-theme: Change presumed CWD
The executable is assumed to be run from $top_srcdir/src, which is
essentially an autotools left-over (it's where the program ended
up with srcdir == builddir).
Now with meson, its actual srcdir makes more senses.
Florian Müllner [Fri, 15 Feb 2019 16:04:10 +0000 (17:04 +0100)]
gtk-embed: Hide window actors from pick
Since we started to support tray icons on wayland, the icon we show
is not the actual XEmbed window. Instead, we let mutter create a
MetaWindow for it, then use its window actor as source for a clone
we (or nowadays: extensions) can add, remove and destroy freely.
To not let the real icon get in the way, we set an empty input shape
and make its window actor fully transparent. This works OK on X11,
but on wayland all events still go through Clutter, so any reactive
surface actor inside the window actor will block events for any actors
underneath (and status icons go into the top-windows group, so almost
all actors are affected).
Luckily we can pile another hack onto the pile of status icon hacks ...
Benjamin Berg [Sat, 2 Mar 2019 15:49:55 +0000 (16:49 +0100)]
shellDBus: Add UngrabAccelerators
While it is possible to register accelerators in-bulk, there is no
proper way to unregister them again. This adds the corresponding call
for UngrabAccelerator to allow ungrabbing multiple accelerators at the
same time.
The idea is that g-s-d can use this in the future to simplify the
keybinding reload logic.
Florian Müllner [Sat, 2 Mar 2019 19:53:33 +0000 (20:53 +0100)]
messageTray: Add source policy setter
Commit 8f15193b4 changed the `policy` property from a regular JS property to
a getter. This was necessary to avoid calling an overridden _createPolicy()
method before a subclass is properly initialized, but it broke the second
way of using notification sources:
Don't create a Source subclass, but use the base class directly and change
its `policy` property.
There's no good reason why we should no longer allow this, so add a setter.
Florian Müllner [Sat, 2 Mar 2019 20:15:03 +0000 (21:15 +0100)]
windowAttentionHandler: Don't destroy on open
The activateWindow() call is expected to focus the window, which
already destroys the source. If we then destroy it again explicitly,
we get another "invalid access" warning.
Florian Müllner [Sat, 2 Mar 2019 19:46:28 +0000 (20:46 +0100)]
network: Don't destroy wireless dialog twice
The dialog doesn't change the `destroyOnClose` property from its default,
so it is already destroyed automatically on close. So if we also destroy
it explicitly, we end up (rightfully) with one of gjs' infamous "invalid
access" warnings.
verdre [Sat, 24 Nov 2018 23:45:19 +0000 (00:45 +0100)]
search: Hide the separator line of the last result
If a result is displayed at the end of the search results, there should
obviously not be a line separating it from the next result underneath
it. To fix this, always hide the separator for the last result visible.